<template>
	<view class="question-page">
		<view class="question-page-header">
			<mynavBar :title="title" :imgurl="questionlogoImage(`questionlogo1`)" :gps="gps" :bgcolor="bgColor">
			</mynavBar>
		</view>
		<!-- 内容部分 -->
		<view class="question-content">
			<!-- 头部选择器 -->
			<view class="question-content-header">
				<view class="content-headermidel">
					<view class="content-headermidel-list" v-for="(item,index) in headerlist" :key="item.id"
						:class="headerindex==item.id?'content-headermidel-listactive':''" @click="changeindex(item.id)">
						<span>{{item.name}}</span>
					</view>
				</view>
			</view>
			<!-- 普通提问的问题 -->
			<view class="question-content-body" v-if="headerindex=='1'">
				<!-- 提交内容部分 -->
				<view class="content-body-midel">
					<view class="body-midel-topinp">
						<uni-easyinput v-model="textvalueone" :styles="styles" :placeholderStyle="placeholderStyle"
							placeholder="在此输入您的问题" @input="input"></uni-easyinput>
					</view>
					<view class="body-mideltextarea">
						<uni-easyinput type="textarea" v-model="textareavalue" placeholder="补充问题相关细节描述 (选填)"
							maxlength="3000"></uni-easyinput>
					</view>
					<view class="body-midel-bottom">
						<view class="midel-bottom-top">
							<span>可上传最多5张照片</span>
						</view>
						<view class="midel-bottomupload">
							<!-- #ifdef MP-WEIXIN -->
							<u-upload :fileList="fileList1" @beforeRead="beforeRead" @afterRead="afterRead"
								@delete="deletePic" name="1" multiple :maxCount="5" uploadIcon="plus"></u-upload>
							<!-- #endif -->
							<!-- #ifdef H5 -->
							<view class="onloadimg">
								<view style="width: 120rpx; height: 120rpx;margin-right: 10rpx; position: relative;"
									v-for="(item,index) in fileList1" :key="index">
									<view style="position: absolute;top: 0;right: 0;" @click="clearimg(index)">
										<uni-icons type="clear" size="20"></uni-icons>
									</view>
									<img :src="item" alt="" style="width: 120rpx; height: 120rpx;">
								</view>

								<view class="onloadimg-btn" @click="onloadImg" v-if="fileList1?.length<5">
									<uni-icons type="plusempty" size="30"></uni-icons>
								</view>
							</view>
							<!-- #endif -->
						</view>

					</view>

				</view>
				<!-- t提交按钮 -->
				<view class="content-body-submit" :class="btnbleam?'content-body-submitactive':''"
					@click="checkUserQuestion(true)">
					<!-- <button @click="testBtn">测试</button> -->
					<span>提问</span>
				</view>
				<span class="content-body-text">提问发布后,所有人都可参与回答</span>
				<view class="content-body-refer">
					<p class="body-refer-title">提问参考</p>
					<p class="body-refer-prompt">提示:&nbsp;您可以在向社区答主提问乐器相关问题.</p>
					<p class="body-refer-text">例：问题标题（钢琴的弹奏水平靠哪方面来决定？）</p>
					<p>问题描述（钢琴的弹奏水平主要看技巧，还是要看对音乐的理解与表达等综合音乐知识，靠哪方面来决定？）</p>
				</view>
			</view>
			<!-- 悬赏提问模块 -->
			<view class="question-content-reward" v-if="headerindex=='2'">
				<view class="content-reward-prompt">
					<p>只有被邀请的答主回获得悬赏</p>
					<p>如未邀请答主，则由优先回答的答主获得</p>
				</view>
				<view class="content-reward-appoint">
					<view class="reward-appoint-header">
						<view class="appoint-header-title">
							<span>{{appointswitch?'随机答主':'指定答主'}}</span>
						</view>
						<span>{{appointswitch?'平台认证答主都可以回答您的提问':'最多可指定三位答主回答悬赏提问'}}</span>
					</view>
					<view class="reward-appoint-content">
						<view class="appoint-content-left">
							<view class="content-left-list" v-for="(item,index) in appointlist" :key="item.id">
								<view class="content-left-listimg" v-if="appointswitch">
									<img :src="queryIconImage(`appointlogo3`)" alt="" class="content-left-listlogo">
								</view>
								<view class="content-left-listimg" v-if="!item.img && !appointswitch"
									@click="selectquestion('bottom',index)">
									<img :src="queryIconImage(`appointlogo1`)" alt="" class="content-left-listlogo">
								</view>
								<view class="content-left-listimgtwo" v-if="item.img && !appointswitch"
									@click="selectquestion('bottom',index)">
									<img :src="item.img" alt="" class="content-left-listlogotwo">
								</view>
								<span>{{ !appointswitch?item.name?item.name:'未选择':'随机'}}</span>
							</view>
						</view>
						<view class="appoint-content-right" @click="appswitch">
							<img :src="queryIconImage(`appointlogo2`)" alt="" class="content-right-img">
							<span>{{appointswitch?'切换至指定答主':'切换至随机答主'}}</span>
						</view>

					</view>
				</view>
				<!-- 公开悬赏问题 -->
				<view class="content-reward-open">
					<view class="reward-open-left">
						<span class="open-left-text">公开悬赏提问</span>
						<span>开启！提问发布后，所有人都可参与回答</span>
					</view>
					<view class="reward-open-right" v-if="!appointswitch" @click="toggle('center')">
						<switch checked color="#F09500" style="transform:scale(1.1,1)" @change="changswith" />
					</view>
				</view>
				<!-- 提交内容部分 -->
				<view class="content-body-midel">
					<view class="body-midel-topinp">
						<uni-easyinput v-model="textvaluetwo" :styles="styles" :placeholderStyle="placeholderStyle"
							placeholder="在此输入您的问题" @input="inputtwo"></uni-easyinput>
					</view>
					<view class="body-mideltextarea">
						<uni-easyinput type="textarea" v-model="textareavaluetwo" placeholder="补充问题相关细节描述 (选填)"
							maxlength="3000"></uni-easyinput>
					</view>
					<view class="body-midel-bottom">
						<view class="midel-bottom-top">
							<span>可上传最多5张照片与1个最长为10分钟的视频</span>
						</view>
						<view class="midel-bottomupload">
							<!-- #ifdef MP-WEIXIN -->
							<u-upload :fileList="fileListtwo1" @afterRead="afterReadtwo" @delete="deletePictwo" name="1"
								multiple :maxCount="5" uploadIcon="plus" v-if="pohoeload"></u-upload>
							<u-upload :fileList="fileList2" @afterRead="afterReadvideo" @delete="deletePicvideo"
								name="2" multiple :maxCount="1" accept="video" v-if="videoload"></u-upload>
							<!-- #endif -->
							<!-- #ifdef H5 -->
							<view class="bottomupload-view">
								<view style="width: 120rpx; height: 120rpx;margin-right: 10rpx; position: relative;"
									v-for="(item,index) in fileListtwo1" :key="index">
									<view style="position: absolute;top: -10rpx;right: -10rpx;"
										@click="clearimgtwo(index)">
										<uni-icons type="clear" size="20"></uni-icons>
									</view>
									<img :src="item" alt="" style="width: 120rpx; height: 120rpx;">
								</view>
								<view style="width: 120rpx; height: 120rpx;margin-right: 10rpx; position: relative;"
									v-for="(item,index) in fileList2" :key="index">
									<view style="position: absolute;top: -10rpx;right: -10rpx;"
										@click="clearimgthree(index)">
										<uni-icons type="clear" size="20"></uni-icons>
									</view>
									<video :src="item" style="width: 120rpx; height: 120rpx;"></video>
								</view>

								<view class="onloadimg-btn" @click="onloadImgtwo"
									v-if="fileListtwo1?.length<5 &&fileList2?.length<1">
									<uni-icons type="plusempty" size="30"></uni-icons>

								</view>
								<view class="onloadimg-btn" @click="onloadImgthree"
									v-if="fileListtwo1?.length<1 &&fileList2?.length<1">
									<uni-icons type="videocam" size="30"></uni-icons>
								</view>
							</view>
							<!-- #endif -->
						</view>

					</view>

				</view>
				<!-- 选择赏金 -->
				<view class="content-reward-bounty">
					<p class="reward-bounty-title">选择赏金</p>
					<view
						style="margin-left:28rpx;margin-bottom: 34rpx;font-size:26rpx;font-weight: 500;color: #F09500;">
						Tips：此处为悬赏提问的总金额，受邀答主将均分赏金</view>
					<view class="reward-bounty-content">
						<span class="bounty-content-moeny" @click="moneychange(index)"
							:class="moneyindex==index?'bounty-content-moenyactive':''"
							v-for="(item,index) in bountylist" :key="item.id">{{item.name}}元</span>
						<input type="number" min="1" max="5" @focus="clickinput" v-model="moneyvalue" placeholder="更高"
							class="bounty-content-input">
					</view>
				</view>
				<!-- 提交按钮 -->
				<view class="content-reward-submitbtn" :class="rewardbtnbleam?'content-reward-submitbtnactive':''"
					@click="checkUserQuestion(false)">
					<span>提交</span>
				</view>
			</view>
		</view>
		<!-- <u-keyboard mode="number" @close="closekedowns" :tooltip="false" @change="valChange" @backspace="backspace"
			:dotDisabled="true" :show="keydownshow"></u-keyboard> -->
		<!-- 公开悬赏弹窗 -->
		<uni-popup ref="popup" background-color="#fff" @change="popuchange">
			<view class="popup-content">
				<img :src="queryIconImage(`questionpopulogo1`)" alt="" class="popup-content-img">
				<p class="popup-content-title">友情提示</p>
				<span class="popup-content-text">选择不公开悬赏提问，你将不会得到额外收益，因为其他人付费查看答主的内容也会为你带来收益</span>
				<view class="popup-content-submitbtn" @click="closepopup">
					<span>关闭</span>
				</view>
			</view>
		</uni-popup>
		<!-- 选择答主弹框 -->
		<uni-popup ref="selectpopup" background-color="#fff" @change="selectchange">
			<view class="popup-contenttwo">
				<view class="popup-contenttwo-search">
					<uni-easyinput prefixIcon="search" v-model="selsectseach" placeholder="搜索答主" @iconClick="iconClick"
						styles="width: 100%;
				height: 80rpx;border-radius: 15rpx 15rpx 15rpx 15rpx;
border: 1rpx solid #AAAAAA;" @confirm="searchuserlist" @blur="searchuserlist"></uni-easyinput>
				</view>
				<view class="popup-contenttwo-content">
					<view class="contenttwo-content-list" v-for="(item,index) in selectquestionlist" :key="item.id">
						<view class="content-list-left">
							<img :src="item.avatar?.url?item.avatar?.url:queryIcon('modelone1')" alt=""
								class="list-left-img" @click="gotoAnswerDetail(item.id)">
							<view class="list-left-content">
								<view class="left-content-top">
									<span class="content-top-text">{{item.nickname}}</span>
									<uni-rate size="14" allow-half :readonly="true" :value="item.score" />
									<span
										style="margin-left: 5rpx; margin-top: 4rpx;">{{(item.score!='NaN'?item.score:'暂无评分')}}</span>
								</view>
								<view class="left-content-bottom">
									<span>专业标签:&nbsp;</span>
									<span class="content-bottom-text" v-for="(v,i) in item.attach_data"
										:key="i">{{v.label}}</span>
								</view>
							</view>
						</view>
						<view class="content-list-right" @click="closeselectquetion(item)">
							<span>选TA回答</span>
						</view>
					</view>
				</view>

			</view>
		</uni-popup>
		<u-popup :safeAreaInsetBottom="false" mode="center" :round="20" :show="show" @close="close" @open="open">
			<view class="popularlogin">
				<img :src="queryIconImage('weixinlogo1')" alt="" style="width: 60rpx;height: 60rpx;">
				<p class="popularlogin-text">登录后查看</p>
				<view class="popularlogin-btn">
					<view class="popularlogin-btn-left" @click="loginsubmit">
						<span>授权登录</span>
					</view>
					<view class="popularlogin-btn-left" style="background: #999999;" @click="cancellationbtn">
						<span>取消</span>
					</view>
				</view>
			</view>
		</u-popup>
		<my-tabbar v-if="!selectpopu" :selected="selected"></my-tabbar>
	</view>
</template>

<script>
	import methods from "@/pages/index/methods.js"
	import {
		mapState
	} from 'vuex'
	import mynavBar from '../../components/mynavBar/mynavBar.vue'
	import MyTabbar from '@/components/my-tabbar/my-tabbar.vue'
	import {
		watch
	} from "vue";
	export default {
		components: {
			MyTabbar,
			mynavBar
		},
		data() {
			return {
				platformRatio: 0, // 平台抽成比例
				show: false,
				videoid: [],
				imgid1: [],
				imgid2: [],
				pohoeload: true,
				videoload: true,
				fileList2: [],
				fileListtwo1: [],
				fileList1: [],
				textareavaluetwo: '',
				textareavalue: '',
				placeholderStyle: 'font-size: 36rpx;font-family: Source Han Sans CN-Bold, Source Han Sans CN;font-weight: 700;color: #5F5F5F;line-height: 52rpx;',
				styles: {
					width: '100%',
					border: 'none',
				},
				textvaluetwo: '',
				textvalueone: '',
				bgColor: 'rgba(165, 42, 42, 0)',
				gps: '',
				selectindex: 0,
				selectquestionlist: [{
					id: '1',
					name: "echo",
					lableList: [{
						text: '心理咨询'
					}, {
						text: '学习方法'
					}],
					score: '4.5'
				}, {
					id: '2',
					name: "大魔王",
					lableList: [{
						text: '心理咨询'
					}],
					score: '3'
				}],
				selsectseach: '',
				selectpopu: false,
				/* 键盘 */
				keydownshow: false,
				/* 赏金列表 */
				bountylist: [{
					id: '1',
					name: '10'
				}, {
					id: "2",
					name: '30'
				}, {
					id: "3",
					name: "60"
				}, {
					id: '4',
					name: '120'
				}],
				moneyvalue: null,
				moneyindexvalue: 0,
				moneyindex: 0,
				type: '',
				swithbtn: true,
				appointswitch: false,
				appointlist: [{
					id: '1',
					name: "",
					img: ''
				}, {
					id: '2',
					name: "",
					img: ''
				}, {
					id: '3',
					name: "",
					img: ''
				}],
				rewardbtnbleam: false,
				btnbleam: false,
				headerindex: '1',
				headerlist: [{
					id: '1',
					name: "普通提问"
				}, {
					id: "2",
					name: "悬赏提问"
				}],
				selected: 1,
				title: "提问",
				plugin: {},
				is_pass: false
			};
		},
		computed: {
			...mapState({
				iconList: state => state.remote?.iconList?.data_list ?? [],
				headericon: state => state.remote?.headericon?.data_list ?? [],
				questionlogo: state => state.remote?.questionlogo?.data_list ?? [],
			})
		},
		mounted() {
			this.getRewardRatioConfig()
			this.querySections().then(res => {
				this.selectquestionlist.map(item => {
					item.img = this.queryIcon('modelone1')
				})
			})
		},
		onLoad: function(option) {
			//#ifdef MP-WEIXIN
			let arr = wx.getMenuButtonBoundingClientRect()
			this.gps = arr.top + ''
			console.log("胶囊位置信息", arr);
			// this.initChatbot()
			//#endif

		},
		onShow() {
			if (!uni.getStorageSync('userInfo').id) {
				this.show = true
			}



			let chiderenval = getApp()
			if (chiderenval.val) {
				let data = JSON.parse(chiderenval.val)
				this.appointlist[0].id = data.id
				this.appointlist[0].img = data.avatar?.url ? data.avatar?.url : this.queryIcon('modelone1')
				this.appointlist[0].name = data.nickname
				this.headerindex = "2"
				console.log('getapp上的数据', chiderenval.val);
			} else {
				console.log("getapp上的数据为空");
			}
			this.initChatbot()

		},

		onPageScroll(e) {
			//获取距离顶部距离
			const scrollTop = e.scrollTop;
			console.log("高度：", scrollTop)
			// 根据高度改变样式
			if (scrollTop < 99) {
				this.bgColor = 'rgba(247, 247, 247, 0)'

			} else if (scrollTop >= 99 && scrollTop < 150) {
				this.bgColor = 'rgba(247, 247, 247, 0.5)'
			} else if (scrollTop >= 150) {
				this.bgColor = 'rgba(247, 247, 247, 1)'
			}
		},
		methods: {
			...methods,
			//跳转到答主个人页面
			gotoAnswerDetail(id) {
				uni.navigateTo({
					url: `/pages_a/answerdetails/answerdetails?id=${id}`
				})
			},
			//初始化敏感词检测
			initChatbot() {
				console.log("初始化-----");
				let md_userInfo = uni.getStorageSync('userInfo')
				this.plugin = requirePlugin("chatbot");
				this.plugin.init({
					appid: "H4USdd5OjHDg76W3I6YsZp1Pv2Ua14", //小程序示例账户，仅供学习和参考
					openid: typeof(md_userInfo) == 'string' ? "oWj3G5T2WhDvApo19fioZkIyKup8" : md_userInfo
						.wx_mini_openid, //用户的openid，非必填，建议传递该参数
					success: () => {
						console.log("插件初始化成功");
					}, //非必填
					fail: (error) => {
						console.log("插件初始化失败");
					}, //非必填
				});

			},
			queryIcon(label, key = "headericon") {
				return this[key]?.find(res => res?.label == label)?.img?.url;
			},
			queryIconImage(label, key = "iconList") {
				return this[key]?.find(res => res?.label == label)?.img?.url;
			},
			questionlogoImage(label, key = "questionlogo") {
				return this[key]?.find(res => res?.label == label)?.img?.url;
			},
			//点击输入框的事件
			clickinput() {
				this.moneyindex = 100
			},
			loginsubmit() {
				uni.navigateTo({
					url: `/pages/login/login?url=${'/pages/question/question'}`
				})
				this.show = false
			},
			cancellationbtn() {
				uni.switchTab({
					url: '/pages/index/index'
				})
			},
			// h5上传事件
			onloadImg() {
				uni.chooseImage({
					count: 6, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: async (res) => {
						// const url = URL.createObjectURL(res.tempFilePaths[0]);
						console.log(res, '1111111111');
						res.tempFilePaths.forEach((v, i) => {
							this.fileList1.push(v)
						})
						res.tempFiles.forEach(async (v, i) => {
							let add = await this.up_image_id(v)
							this.imgid1.push(add)

						})
					}
				})
			},
			//h5删除图片事件
			clearimg(index) {
				this.fileList1.splice(index, 1)
				this.imgid1.splice(index, 1)
				console.log("获取的img_id视频", this.imgid1, this.fileList1)
			},
			clearimgtwo(index) {
				this.fileListtwo1.splice(index, 1)
				this.imgid2.splice(index, 1)
				console.log("获取的img_id视频", this.imgid2, this.fileListtwo1)
			},
			clearimgthree(index) {
				this.fileList2 = []
				this.videoid = []
			},
			onloadImgtwo() {
				uni.chooseImage({
					count: 6, //默认9
					sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图，默认二者都有
					sourceType: ['album'], //从相册选择
					success: async (res) => {
						// const url = URL.createObjectURL(res.tempFilePaths[0]);
						console.log(res, '1111111111');
						res.tempFilePaths.forEach((v, i) => {
							this.fileListtwo1.push(v)
						})
						res.tempFiles.forEach(async (v, i) => {
							let add = await this.up_image_id(v)
							this.imgid2.push(add)

						})
					}
				})
			},
			//h5上传视频
			onloadImgthree() {
				uni.chooseVideo({
					sourceType: ['camera', 'album'],
					success: async (res) => {
						this.fileList2[0] = res.tempFilePath
						let add = await this.up_video_id(res.tempFile)
						this.videoid[0] = add
						console.log('上传视频的文件.........', this.videoid);
					}
				});
			},
			searchuserlist() {
				this.$store.dispatch("remote/query", {
					model: 'user',
					limit: 100,
					where: {
						_and: [{
							is_answer: {
								_eq: '已通过'
							}
						}, {
							nickname: {
								_like: `%${this.selsectseach}%`
							}
						}]

					},
					field_string: 'id nickname avatar{url} profile attach_data article_comment_score{id score}'
				}).then(res => {

					this.selectquestionlist = JSON.parse(JSON.stringify(res.data_list))
					for (let i in this.selectquestionlist) {
						let count = 0
						for (let j in this.selectquestionlist[i].article_comment_score) {
							count += this.selectquestionlist[i].article_comment_score[j].score
						}
						this.selectquestionlist[i].score = (count / this.selectquestionlist[i]
							.article_comment_score
							.length).toFixed(2)

					}
					console.log('认证的答主123', this.selectquestionlist);
				})

			},
			// 删除图片
			deletePic(event) {
				this[`fileList${event.name}`].splice(event.index, 1)
				this.imgid1.splice(event.index, 1)
				console.log('删除的下标', event.index);
			},
			async afterRead(event) {
				console.log('---event', event);
				// 当设置 mutiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this[`fileList${event.name}`].length
				lists.map((item) => {
					this[`fileList${event.name}`].push({
						...item,
					})
				})
				console.log('上传的图片', event);
				// event.file
				for (let i = 0; i < lists.length; i++) {
					let arr = {}
					arr.path = lists[i].url
					let add = await this.up_image_id(arr)
					this.imgid1.push(add)
				}
			},
			// 上传前的处理函数
			beforeRead(event) {
				console.log('上传前的处理函数', event);
			},
			up_image_id(data) {
				console.log('---', data.path);
				return this.$store.dispatch("app/upload", {
					method: "uimage",
					isloading: false,
					file: data
				}).then(res => {
					console.log("res.imageId....................", res.imageId)
					return res.imageId
				}).catch(error => {
					console.log('----', error);
				})
			},
			async up_video_id(data) {
				let video_id = await this.$store.dispatch("app/upload", {
					method: "uvideo",
					isloading: false,
					file: data
				}).then(res => {
					console.log("res.videoId....................", res.videoId)
					return res.videoId
				})
				return video_id
			},
			// 删除图片
			deletePictwo(event) {
				this[`fileListtwo${event.name}`].splice(event.index, 1)
				this.imgid2.splice(event.index, 1)
				// if (this.fileListtwo1.length > 0) {
				// 	this.videoload = false
				// } else {
				// 	this.videoload = true
				// }
			},
			async afterReadtwo(event) {
				// 当设置 mutiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this[`fileListtwo${event.name}`].length
				lists.map((item) => {
					this[`fileListtwo${event.name}`].push({
						...item,
						// status: 'uploading',
						// message: '上传中'
					})
				})
				let arr = {}
				for (let i = 0; i < lists.length; i++) {
					let arr = {}
					arr.path = lists[i].url
					let add = await this.up_image_id(arr)
					this.imgid2.push(add)
				}
				console.log('上传的图片', this.imgid2);
				// if (lists.length > 0) {
				// 	this.videoload = false
				// } else {
				// 	this.videoload = true
				// }
			},
			// 删除视频
			deletePicvideo(event) {
				this[`fileList${event.name}`].splice(event.index, 1)
				this.videoid.splice(event.index, 1)
				// if (this.fileList2.length > 0) {
				// 	this.pohoeload = false
				// } else {
				// 	this.pohoeload = true
				// }
			},
			async afterReadvideo(event) {
				if (event.file[0].duration > 600) {
					uni.showToast({
						icon: "none",
						title: "您上传的视频时长超过10分钟，请重新选择！",
						duration: 2500
					})
					return
				}

				// 当设置 mutiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this[`fileList${event.name}`].length
				lists.map((item) => {
					this[`fileList${event.name}`].push({
						...item,
						// status: 'uploading',
						// message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					let arr = {}
					arr.path = lists[i].url
					let add = await this.up_video_id(arr)
					this.videoid.push(add)
				}
				console.log('上传的视频', this.videoid);
				// if (lists.length > 0) {
				// 	this.pohoeload = false
				// } else {
				// 	this.pohoeload = true
				// }
			},
			/* 点击选择他回答事件 */
			closeselectquetion(data) {
				this.appointlist.forEach(v => {
					if (v.id == data.id) {
						v.id = ''
						v.img = ''
						v.name = ''
					}
				})
				this.appointlist[this.selectindex].id = data.id
				this.appointlist[this.selectindex].img = data.avatar?.url ? data.avatar?.url : this.queryIcon('modelone1')
				this.appointlist[this.selectindex].name = data.nickname


				this.$refs.selectpopup.close()
			},
			iconClick() {

			},
			/* 选择博主模态框关闭后开启tabbar */
			selectchange(e) {
				if (e.show) {
					this.selectpopu = e.show
				} else {
					setTimeout(() => {
						this.selectpopu = e.show
					}, 500)
				}

			},
			input(event) {
				console.log("输入框输入事件", event);
				if (event) {
					this.btnbleam = true
				} else {
					this.btnbleam = false
				}
			},
			inputtwo(event) {
				if (event) {
					this.rewardbtnbleam = true
				} else {
					this.rewardbtnbleam = false
				}
			},
			/* 点击选择博主事件 */
			selectquestion(type, index) {
				// this.selectpopu = true
				this.selectindex = index
				// 获取答主列表信息
				this.$store.dispatch("remote/query", {
					model: 'user',
					limit: 100,
					where: {
						is_answer: {
							_eq: '已通过'
						}
					},
					field_string: 'id nickname avatar{url} profile attach_data article_comment_score{id score}'
				}).then(res => {

					this.selectquestionlist = JSON.parse(JSON.stringify(res.data_list))
					for (let i in this.selectquestionlist) {
						let count = 0
						for (let j in this.selectquestionlist[i].article_comment_score) {
							count += this.selectquestionlist[i].article_comment_score[j].score
						}
						this.selectquestionlist[i].score = (count / this.selectquestionlist[i]
							.article_comment_score
							.length).toFixed(2)

					}
					console.log('认证的答主1234', this.selectquestionlist);
				})
				this.$refs.selectpopup.open(type)
			},
			moneychange(val) {
				this.moneyindex = val
				this.moneyindexvalue = this.bountylist[val].name
				this.moneyvalue = ""
			},
			closepopup() {
				this.$refs.popup.close()
			},
			toggle(type) {
				this.type = type
				if (!this.swithbtn) {
					this.$refs.popup.open(type)
				}

			},
			popuchange(e) {
				console.log('当前模式：' + e.type + ',状态：' + e.show);
			},
			changswith(e) {
				this.swithbtn = e.detail.value

				console.log("改变事件", this.swithbtn);
			},
			appswitch() {
				this.appointswitch = this.appointswitch ? false : true
				this.swithbtn = true
			},
			changeindex(val) {
				this.headerindex = val
			},
			checkUserQuestion(flag) {
				if (flag) {

					this.plugin.api.nlp('sensitive', {
						q: this.textvalueone,
						mode: 'bert'
					}).then(res => {
						for (let i in res.result) {
							if (res.result[i][0] == 'other') {
								if (res.result[i][1] >= 0.8 && res.result[i][1] <= 1) {
									this.plugin.api.nlp('sensitive', {
										q: this.textareavalue,
										mode: 'bert'
									}).then(ret => {
										for (let i in ret.result) {
											if (ret.result[i][0] == 'other') {
												if (ret.result[i][1] >= 0.8 && ret.result[i][1] <= 1) {
													this.submit()
												} else {
													uni.showToast({
														title: '提交失败，请修改内容后重新提交',
														icon: 'none',
														duration: 1000
													})
												}
											}
										}
									})
								} else {
									uni.showToast({
										title: '提交失败，请修改标题后重新提交',
										icon: 'none',
										duration: 1000
									})
								}
							}
						}
					})

				} else {
					console.log(this.textareavaluetwo, this.textvaluetwo);
					this.plugin.api.nlp('sensitive', {
						q: this.textvaluetwo,
						mode: 'bert'
					}).then(res => {
						for (let i in res.result) {
							if (res.result[i][0] == 'other') {
								if (res.result[i][1] >= 0.8 && res.result[i][1] <= 1) {
									this.plugin.api.nlp('sensitive', {
										q: this.textareavaluetwo,
										mode: 'bert'
									}).then(ret => {
										for (let i in ret.result) {
											if (ret.result[i][0] == 'other') {
												if (ret.result[i][1] >= 0.8 && ret.result[i][1] <= 1) {
													this.rewardsubmit()
												} else {
													uni.showToast({
														title: '提交失败，请修改内容后重新提交',
														icon: 'none',
														duration: 1000
													})
												}
											}
										}
									})
								} else {
									uni.showToast({
										title: '提交失败，请修改标题后重新提交',
										icon: 'none',
										duration: 1000
									})
								}
							}
						}
					})
				}
			},
			// TODO普通提问
			async submit() {
				if (this.btnbleam) {
					this.$store.dispatch("remote/mutation", {
						operation: 'insert_article',
						objects: [{
							user_user: uni.getStorageSync('userInfo').id,
							type: '普通提问',
							answer_type: '公开参与',
							status: this.imgid1.length == 0 ? "展示中" : "展示中",
							title: this.textvalueone,
							content: this.textareavalue,
							heat: 0
						}],
						field_string: 'id'
					}).then(res => {
						console.log('提交成功', res.returning[0].id);
						if (this.imgid1.length > 0) {
							for (let i = 0; i < this.imgid1.length; i++) {
								this.$store.dispatch("remote/mutation", {
									operation: 'insert_article_detail',
									objects: [{
										article_article: res.returning[0].id,
										img_id: this.imgid1[i]
									}],
								}).then(ree => {
									console.log("照片上传成功", ree);
									this.moneyindex = 0
									this.textvaluetwo = ''
									this.textareavalue = ''
									this.fileList2 = []
									this.videoid = []
									this.textareavaluetwo = ''
									this.moneyvalue = ''
									this.appointlist = [{
										id: '1',
										name: "",
										img: ''
									}, {
										id: '2',
										name: "",
										img: ''
									}, {
										id: '3',
										name: "",
										img: ''
									}]
									this.textvalueone = ''
									this.textareavalue = ''
									this.fileList1 = []
									this.imgid1 = []
									this.fileListtwo1 = []
									this.rewardbtnbleam = false
									this.btnbleam = false
									this.appointswitch = false

									uni.showToast({
										title: '提问成功',
										duration: 2000,
										icon: 'success'
									});
									uni.navigateTo({
										url: "/pages_a/successquestion/successquestion"
									})
								})
							}
						} else {
							uni.navigateTo({
								url: "/pages_a/successquestion/successquestion"
							})
							this.moneyindex = 0
							this.textvaluetwo = ''
							this.textareavalue = ''
							this.fileList2 = []
							this.videoid = []
							this.textareavaluetwo = ''
							this.moneyvalue = ''
							this.appointlist = [{
								id: '1',
								name: "",
								img: ''
							}, {
								id: '2',
								name: "",
								img: ''
							}, {
								id: '3',
								name: "",
								img: ''
							}]
							this.textvalueone = ''
							this.textareavalue = ''
							this.fileList1 = []
							this.imgid1 = []
							this.fileListtwo1 = []
							this.rewardbtnbleam = false
							this.btnbleam = false
							this.appointswitch = false
						}
					})
				}
			},

			getRewardRatioConfig() {
				const field_string = `id platform questioner answer type`;
				this.$store.dispatch("remote/query", {
					model: "reward_ratio_config",
					where: {
						type: {
							_eq: "悬赏提问比例"
						},
					},
					field_string: field_string
				}).then(res => {
					this.platformRatio = res.data.platform
				})
			},



			async rewardsubmit() {
				console.log(this.moneyindex);
				let str = ''
				let strtwo = ''
				let moenynum = 0
				let is_inList = false

				if (this.appointswitch) {
					str = '随机答主'
				} else {
					str = '指定答主'
					let boolean = this.appointlist?.some(item => item.img)
					if (!boolean) {
						uni.showToast({
							title: '请指定回答的答主',
							duration: 2000,
							icon: 'none'
						});
						return
					}
				}
				if (this.swithbtn) {
					strtwo = '公开参与'
				} else {
					strtwo = '答主参与'
				}
				if (this.moneyvalue) {
					moenynum = this.moneyvalue
				} else {
					if (this.moneyindexvalue == 0) {
						moenynum = this.bountylist[0].name
					} else {
						moenynum = this.moneyindexvalue
					}
				}
				for (let i in this.bountylist) {
					if (moenynum == this.bountylist[i].name) {
						is_inList = true
						break
					}
				}

				if (moenynum <= 0) {
					uni.showToast({
						title: '悬赏提问金额不能为0',
						duration: 2000,
						icon: 'none'
					});
					return
				}
				if (moenynum % 10 !== 0) {
					uni.showToast({
						title: '悬赏提问金额必须为10的倍数',
						duration: 2000,
						icon: 'none'
					});
					return
				}
				if (moenynum > 500) {
					uni.showToast({
						title: '悬赏提问金额最高为500元',
						duration: 2000,
						icon: 'none'
					});
					return
				}

				if (this.moneyindex == 100 && moenynum <= 120) {
					uni.showToast({
						title: '悬赏提问自选金额不低于120元',
						duration: 2000,
						icon: 'none'
					});
					return
				}

				this.$store.dispatch("remote/query", {
					model: 'user_assets',
					where: {
						user_user: {
							_eq: uni.getStorageSync('userInfo').id
						}
					},
					field_string: 'id type balance describe status',
				}).then(res => {
					console.log("获取用户资产", res.data)
					let usermoney = res.data?.balance
					let moenynumall = moenynum * 100
					if (usermoney >= moenynumall) {
						if (this.rewardbtnbleam) {
							this.$store.dispatch("remote/mutation", {
								operation: 'insert_article',
								objects: [{
									user_user: uni.getStorageSync('userInfo').id,
									type: '悬赏提问',
									answer_type: strtwo,
									status: this.imgid2.length == 0 && this.videoid.length ==
										0 ? "展示中" : "展示中",
									title: this.textvaluetwo,
									content: this.textareavaluetwo,
									price_cny: moenynumall,
									heat: 50
								}],
								field_string: 'id title'
							}).then(res => {
								let usertitle = res.returning[0].title
								console.log("悬赏提问提交成功", res.returning[0].id);
								this.$store.dispatch("remote/mutation", {
									operation: 'update_user_assets',
									where: {
										user_user: {
											_eq: uni.getStorageSync('userInfo').id
										}
									},
									_set: {
										balance: usermoney - moenynumall,
									},
									field_string: 'id type balance describe status'
								}).then(resw => {
									if (resw.returning[0]?.id) {
										console.log("减少金额成功", resw)
										this.$store.dispatch("remote/mutation", {
											operation: 'insert_user_assets_detail',
											objects: [{
												user_assets_user_assets: resw
													.returning[0]?.id,
												change_val: parseInt(
													moenynumall),
												init_val: parseInt(usermoney),
												balance: resw.returning[0]
													?.balance,
												describe: usertitle +
													"-悬赏提问消耗" +
													moenynum + "元",
												blean: false,
												type: '减少'
											}],
										}).then(resw => {
											console.log("创建记录成功", resw)
										})
									}
								})
								if (str == '指定答主') {
									for (let q = 0; q < this.appointlist.length; q++) {
										if (this.appointlist[q].img) {
											console.log('指定答主qqqqqqqq', str);
											this.$store.dispatch("remote/mutation", {
												operation: 'insert_article_answer',
												objects: [{
													article_article: res.returning[0]
														.id,
													user_user: this.appointlist[q].id,
													price: parseInt(moenynum * (1 -
															this
															.platformRatio) /
														this.appointlist.filter(
															rs =>
															rs.img != "").length *
														100
													),
													status: "待回答",
													type: "指定答主"

												}],
											}).then(rescha => {
												console.log("指定答主成功", rescha);
											})
										}
									}
								}
								if (str == '随机答主') {
									this.$store.dispatch('remote/mutation', {
										operation: 'insert_article_answer',
										objects: [{
											article_article: res.returning[0].id,
											price: parseInt(moenynum * (1 - this
												.platformRatio) / 3 * 100),
											status: "待回答",
											type: "随机答主"
										}, {
											article_article: res.returning[0].id,
											price: parseInt(moenynum * (1 - this
												.platformRatio) / 3 * 100),
											status: "待回答",
											type: "随机答主"
										}, {
											article_article: res.returning[0].id,
											price: parseInt(moenynum * (1 - this
												.platformRatio) / 3 * 100),
											status: "待回答",
											type: "随机答主"
										}],
									})
								}



								// if (str == '随机答主') {
								// 	this.$store.dispatch("app/runActionflowmain", {
								// 		args: {
								// 			actionflow_name: "随机答主回答",
								// 		},
								// 		isloading: false
								// 	}).then(rs => {
								// 		if (rs.status == "成功") {
								// 			for (let q = 0; q < rs.data.length; q++) {
								// 				this.$store.dispatch("remote/mutation", {
								// 					operation: 'insert_article_answer',
								// 					objects: [{
								// 						article_article: res
								// 							.returning[0].id,
								// 						user_user: rs.data[q]
								// 							.id,
								// 						price: parseInt(
								// 							moenynum *
								// 							(1 - this
								// 								.platformRatio
								// 							) / rs.data
								// 							.length) * 100,
								// 						status: "待回答",
								// 						type: "随机答主"

								// 					}],
								// 					isloading: false
								// 				})
								// 			}
								// 		} else {
								// 			uni.showToast({
								// 				title: "暂无答主"
								// 			})
								// 			return
								// 		}
								// 	})
								// }


								if (this.imgid2.length > 0 || this.videoid.length > 0) {
									for (let i = 0; i < this.videoid.length; i++) {
										this.$store.dispatch("remote/mutation", {
											operation: 'insert_article_detail',
											objects: [{
												article_article: res.returning[0].id,
												video_id: this.videoid[i]
											}],
										}).then(ree => {
											for (let i = 0; i < this.imgid2.length; i++) {
												this.$store.dispatch("remote/mutation", {
													operation: 'insert_article_detail',
													objects: [{
														article_article: res
															.returning[0].id,
														img_id: this.imgid2[i]
													}],
												}).then(ret => {
													console.log("照片上传成功", ret);
												})
											}
											console.log("视频上传成功", ree);
											this.moneyindex = 0
											this.textvaluetwo = ''
											this.textareavalue = ''
											this.fileList2 = []
											this.videoid = []
											this.moneyvalue = ''
											this.textareavaluetwo = ''
											this.appointlist = [{
												id: '1',
												name: "",
												img: ''
											}, {
												id: '2',
												name: "",
												img: ''
											}, {
												id: '3',
												name: "",
												img: ''
											}]
											this.textvalueone = ''
											this.textareavalue = ''
											this.fileList1 = []
											this.imgid1 = []
											this.fileListtwo1 = []
											this.rewardbtnbleam = false
											this.btnbleam = false
											this.appointswitch = false
											uni.showToast({
												title: '提问成功',
												duration: 2000,
												icon: 'success'
											});
											uni.navigateTo({
												url: "/pages_a/successquestion/successquestion"
											})
										})
									}
								} else {
									uni.navigateTo({
										url: "/pages_a/successquestion/successquestion"
									})
									this.moneyindex = 0
									this.textvaluetwo = ''
									this.textareavalue = ''
									this.fileList2 = []
									this.videoid = []
									this.moneyvalue = ''
									this.appointlist = [{
										id: '1',
										name: "",
										img: ''
									}, {
										id: '2',
										name: "",
										img: ''
									}, {
										id: '3',
										name: "",
										img: ''
									}]
									this.textvalueone = ''
									this.textareavaluetwo = ''
									this.textareavalue = ''
									this.fileList1 = []
									this.imgid1 = []
									this.fileListtwo1 = []
									this.rewardbtnbleam = false
									this.btnbleam = false
									this.appointswitch = false
								}
							})
						}
					} else {
						uni.showModal({
							title: '提示',
							content: '用户余额不足，是否前往充值',
							success: function(res) {
								if (res.confirm) {
									console.log('用户点击确定');
									uni.navigateTo({
										url: `/pages_a/myrecharge/myrecharge`
									})
								} else if (res.cancel) {
									console.log('用户点击取消');
								}
							}
						})
					}

				})
			}
		},

	}
</script>

<style lang="scss">
	.question-page {
		width: 100%;
		background-color: #f4f4f4;
		height: 100%;

		.popularlogin {
			width: 595rpx;
			height: 370rpx;
			background: #FFFFFF;
			box-sizing: border-box;
			padding: 20rpx 0 40rpx 0;
			border-radius: 15rpx 15rpx 15rpx 15rpx;
			display: flex;
			flex-direction: column;
			align-items: center;

			.popularlogin-text {
				font-size: 32rpx;
				font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
				font-weight: 600;
				color: rgba(0, 0, 0, 0.8);
				line-height: 40rpx;
				margin: 12rpx 0 128rpx 0
			}

			.popularlogin-btn {
				display: flex;
				justify-content: space-between;
				width: 100%;
				box-sizing: border-box;
				padding: 0 65rpx;

				.popularlogin-btn-left {
					width: 215rpx;
					height: 70rpx;
					background: #26C789;
					border-radius: 80rpx 80rpx 80rpx 80rpx;
					text-align: center;
					font-size: 24rpx;
					font-family: Alibaba PuHuiTi 2.0-85 Bold, Alibaba PuHuiTi 20;
					font-weight: 700;
					color: #FFFFFF;
					line-height: 70rpx;
				}
			}
		}


		.uni-popup .uni-popup__wrapper {
			border-radius: 10rpx;
		}

		.popup-contenttwo {
			height: 1148rpx;
			background: #FFFFFF;
			border-radius: 30rpx 30rpx 0rpx 0rpx !important;
			box-sizing: border-box;
			padding: 31rpx 27rpx 0 27rpx;


			.popup-contenttwo-search {
				width: 100%;
				height: 80rpx;
				margin-bottom: 20rpx;
			}

			.popup-contenttwo-content {
				width: 100%;
				height: 100%;
				overflow: hidden;
				overflow-y: auto;

				.contenttwo-content-list {
					height: 110rpx;
					width: 100%;
					border-bottom: 3rpx dashed #ccc;
					box-sizing: border-box;
					padding-top: 20rpx;
					display: flex;
					justify-content: space-between;

					.content-list-left {
						width: 77%;
						display: flex;
						height: 60rpx;

						.list-left-img {
							width: 60rpx;
							height: 60rpx;
							border-radius: 50%;
							margin-right: 30rpx;
						}

						.list-left-content {
							flex: 1;
							height: 60rpx;
							display: flex;
							justify-content: space-between;
							flex-direction: column;

							.left-content-top {
								display: flex;
								font-size: 18rpx;
								font-family: Source Han Sans CN-Medium, Source Han Sans CN;
								font-weight: 500;
								color: #5F5F5F;
								line-height: 30rpx;
								align-items: center;

								.content-top-text {
									display: inline-block;
									width: 130rpx;
									overflow: hidden;
									text-overflow: ellipsis;
									white-space: nowrap;
									text-align: left;
									font-size: 24rpx;
									font-family: Source Han Sans CN-Medium, Source Han Sans CN;
									font-weight: 500;
									color: #333333;
									line-height: 30rpx;
								}
							}

							.left-content-bottom {
								width: 90%;
								font-size: 18rpx;
								font-family: Source Han Sans CN-Medium, Source Han Sans CN;
								font-weight: 500;
								color: #999999;
								line-height: 30rpx;
								overflow: hidden;
								white-space: nowrap;
								text-overflow: ellipsis;

								.content-bottom-text {
									color: #F09500;
									border-bottom: 3rpx solid #F09500;
									margin-right: 12rpx;
								}
							}

						}

					}

					.content-list-right {
						font-size: 24rpx;
						font-family: Source Han Sans CN-Regular, Source Han Sans CN;
						font-weight: 400;
						color: #999999;
						line-height: 60rpx;
					}
				}
			}
		}

		.popup-content {
			width: 595rpx;
			height: 440rpx;
			background: #FFFFFF;
			border-radius: 10rpx;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 20rpx 45rpx 60rpx 55rpx;

			.popup-content-img {
				width: 60rpx;
				height: 60rpx;
				margin-bottom: 10rpx;
			}

			.popup-content-title {
				font-size: 32rpx;
				font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
				font-weight: 600;
				margin-bottom: 35rpx;
				color: rgba(0, 0, 0, 0.8);
				line-height: 40rpx;
			}

			.popup-content-text {
				font-size: 24rpx;
				font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
				font-weight: 500;
				color: #666666;
				line-height: 40rpx;
			}

			.popup-content-submitbtn {
				width: 455rpx;
				height: 70rpx;
				background: #F09500;
				border-radius: 80rpx;
				text-align: center;
				font-size: 24rpx;
				font-family: Alibaba PuHuiTi 2.0-85 Bold, Alibaba PuHuiTi 20;
				font-weight: 700;
				color: #FFFFFF;
				line-height: 70rpx;
				margin-top: 20rpx;
			}
		}

		.question-page-header {
			width: 100%;
			height: 343rpx;
		}

		.question-content {
			padding: 0 27rpx 190rpx 27rpx;
			box-sizing: border-box;
			z-index: -111;
			width: 100%;
			margin-top: -170rpx;
			// background-color: #f4f4f4;

			.question-content-header {
				width: 100%;
				display: flex;
				justify-content: center;
				margin-bottom: 40rpx;

				.content-headermidel {
					width: 445rpx;
					height: 80rpx;
					padding: 5rpx;
					background: #FFFFFF;
					box-shadow: 0rpx 3rpx 15rpx 0rpx rgba(0, 0, 0, 0.1);
					border-radius: 50rpx;
					display: flex;

					.content-headermidel-list {
						height: 80rpx;
						width: 50%;
						text-align: center;
						font-size: 30rpx;
						font-family: Source Han Sans CN-Bold, Source Han Sans CN;
						font-weight: 700;
						color: #3D3D3D;
						line-height: 80rpx;
					}

					.content-headermidel-listactive {
						color: #fff;
						border-radius: 50rpx;
						background: #F09500;
					}

				}
			}

			/* 普通提问板块 */
			.question-content-body {
				width: 100%;
				display: flex;
				flex-direction: column;
				align-items: center;

				/* 提交内容部分 */
				.content-body-midel {
					width: 100%;
					// min-height: 490rpx;
					background: #FFFFFF;
					border-radius: 15rpx;
					opacity: 1;
					border: 1rpx solid #F09500;
					box-sizing: border-box;
					padding: 30rpx;

					.body-midel-topinp {
						width: 100%;
						height: 90rpx;
						border-bottom: 4rpx solid #F09500;
						margin-bottom: 30rpx;

						.is-input-border {
							border: none !important;
						}

						.uni-easyinput__content-input {
							padding-left: 0 !important;
						}
					}

					.body-mideltextarea {
						width: 100%;
						height: 130rpx;


						.is-input-border {
							width: 100%;
							height: 130rpx;
							margin-top: 40rpx !important;
							border: none !important;
							font-size: 24rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #999999;
							line-height: 42rpx;
						}

						.input-padding {
							padding-left: 0 !important;
							padding-top: 20rpx !important;
						}
					}

					.body-midel-bottom {
						width: 100%;
						margin-top: 10rpx;

						.midel-bottom-top {
							width: 100%;
							height: 42rpx;
							font-size: 24rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #999999;
							line-height: 42rpx;

						}

						.midel-bottomupload {
							width: 100%;
							// height: 120rpx;
							margin-top: 10rpx;
							display: flex;
							flex-wrap: wrap;



							.u-upload__button.data-v-c8491d64 {
								width: 110rpx !important;
								height: 110rpx !important;
							}

							.u-upload__wrap__preview__image.data-v-c8491d64 {
								width: 110rpx !important;
								height: 110rpx !important;
							}

							.onloadimg {
								width: 100%;
								display: flex;

								.onloadimg-btn {
									width: 120rpx;
									height: 120rpx;
									background-color: #f4f4f4;
									border: 4rpx solid #ccc;
									display: flex;
									justify-content: center;
									align-items: center;
								}

							}
						}
					}
				}

				.content-body-submit {
					width: 455rpx;
					height: 120rpx;
					background: #E1E1E1;
					border-radius: 80rpx;
					text-align: center;
					font-size: 36rpx;
					font-family: Source Han Sans CN-Bold, Source Han Sans CN;
					font-weight: 700;
					color: #B3B3B3;
					line-height: 120rpx;
					margin-top: 110rpx;
					margin-bottom: 33rpx;
				}

				.content-body-submitactive {
					background-color: #F09500;
					color: #fff;
				}

				.content-body-text {
					font-size: 30rpx;
					font-family: Source Han Sans CN-Medium, Source Han Sans CN;
					font-weight: 500;
					color: #999999;
					line-height: 43rpx;
				}

				.content-body-refer {
					width: 100%;
					height: 360rpx;
					margin-top: 110rpx;
					box-sizing: border-box;
					padding: 15rpx 0 60rpx 20rpx;
					background: #FFFFFF;
					border-radius: 15rpx;
					font-size: 24rpx;
					font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
					font-weight: 500;
					color: #666666;
					line-height: 34rpx;

					.body-refer-title {
						font-size: 32rpx;
						font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
						font-weight: 600;
						color: #000000;
						margin-bottom: 23rpx;
						line-height: 42rpx;
					}

					.body-refer-prompt {
						font-size: 30rpx;
						font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
						font-weight: 500;
						color: #4A4A4A;
						line-height: 42rpx;
						margin-bottom: 40rpx;
					}

					.body-refer-text {
						margin-bottom: 40rpx;
					}
				}
			}

			/* 悬赏提问 */
			.question-content-reward {
				width: 100%;
				display: flex;
				flex-direction: column;
				align-items: center;

				.content-reward-prompt {
					box-shadow: 0px 10rpx 10rpx 0px rgba(0, 0, 0, 0.1);
					width: 750rpx;
					height: 100rpx;
					background: #FFFFFF;
					display: flex;
					flex-direction: column;
					justify-content: center;
					align-items: center;
					font-size: 24rpx;
					font-family: Source Han Sans CN-Medium, Source Han Sans CN;
					font-weight: 500;
					color: #F09500;
					line-height: 35rpx;
				}

				.content-reward-appoint {
					margin: 40rpx 0;
					width: 100%;
					height: 260rpx;
					background: #FFFFFF;
					border-radius: 24rpx 24rpx 24rpx 24rpx;
					box-sizing: border-box;
					padding: 35rpx 32rpx 24rpx 25rpx;

					.reward-appoint-header {
						display: flex;
						height: 60rpx;
						font-size: 24rpx;
						font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
						font-weight: 500;
						color: #666666;
						line-height: 60rpx;
						margin-bottom: 20rpx;

						.appoint-header-title {
							height: 60rpx;
							font-size: 32rpx;
							font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
							font-weight: 600;
							color: rgba(0, 0, 0, 0.8);
							line-height: 60rpx;
							padding-right: 20rpx;
							margin-right: 30rpx;
							border-right: 3rpx solid #ccc;
						}

					}

					.reward-appoint-content {
						display: flex;
						justify-content: space-between;
						align-items: center;

						.appoint-content-left {
							display: flex;

							.content-left-list {
								width: 25%;
								margin-right: 40rpx;
								font-size: 20rpx;
								font-family: Source Han Sans CN-Bold, Source Han Sans CN;
								font-weight: 700;
								color: #3D3D3D;
								// line-height: 42rpx;
								text-align: center;

								.content-left-listimg {
									width: 80rpx;
									height: 80rpx;
									border: 1rpx dashed #848484;
									background: #DDDDDD;
									border-radius: 50%;
									overflow: hidden;
									display: flex;
									justify-content: center;
									box-sizing: border-box;
									align-items: center;
									margin-bottom: 10rpx;

									.content-left-listlogo {
										width: 40rpx;
										height: 40rpx;
									}
								}

								.content-left-listimgtwo {
									width: 100%;
									height: 80rpx;
									border-radius: 50%;
									overflow: hidden;
									display: flex;
									justify-content: center;
									align-items: center;

									.content-left-listlogotwo {
										width: 80rpx;
										height: 80rpx;
										border-radius: 50%;
									}
								}
							}
						}

						.appoint-content-right {
							font-size: 24rpx;
							font-family: Alibaba PuHuiTi 2.0-85 Bold, Alibaba PuHuiTi 20;
							font-weight: 700;
							color: #F09500;
							line-height: 42rpx;
							display: flex;
							flex-direction: column;
							align-items: center;

							.content-right-img {
								width: 50rpx;
								height: 50rpx;
							}
						}
					}
				}

				/* 公开悬赏提问模块 */
				.content-reward-open {
					width: 100%;
					height: 120rpx;
					background: #FFFFFF;
					border-radius: 15rpx;
					box-sizing: border-box;
					padding: 18rpx 15rpx 18rpx 20rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-bottom: 40rpx;

					.reward-open-left {
						height: 100%;
						font-size: 18rpx;
						font-family: Source Han Sans CN-Medium, Source Han Sans CN;
						font-weight: 500;
						color: #F09500;
						line-height: 40rpx;
						display: flex;
						flex-direction: column;
						justify-content: space-between;

						.open-left-text {
							font-size: 32rpx;
							font-family: Alibaba PuHuiTi 2.0-65 Medium, Alibaba PuHuiTi 20;
							font-weight: 600;
							color: rgba(0, 0, 0, 0.8);
							line-height: 40rpx;
						}
					}
				}

				/* 提交内容部分 */
				.content-body-midel {
					width: 100%;
					// height: 490rpx;
					background: #FFFFFF;
					border-radius: 15rpx;
					opacity: 1;
					border: 1rpx solid #F09500;
					box-sizing: border-box;
					padding: 30rpx;

					.body-midel-topinp {
						width: 100%;
						height: 90rpx;
						border-bottom: 4rpx solid #F09500;
						margin-bottom: 30rpx;

						.is-input-border {
							border: none !important;
						}

						.uni-easyinput__content-input {
							padding-left: 0 !important;
						}
					}

					.body-mideltextarea {
						width: 100%;
						height: 130rpx;


						.is-input-border {
							width: 100%;
							height: 130rpx;
							margin-top: 40rpx !important;
							border: none !important;
							font-size: 24rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #999999;
							line-height: 42rpx;
						}

						.input-padding {
							padding-left: 0 !important;
							padding-top: 20rpx !important;
						}
					}

					.body-midel-bottom {
						width: 100%;
						margin-top: 10rpx;


						.midel-bottom-top {
							width: 100%;
							height: 42rpx;
							font-size: 24rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #999999;
							line-height: 42rpx;

						}

						.midel-bottomupload {
							width: 100%;
							// height: 120rpx;
							margin-top: 10rpx;
							display: flex;
							flex-wrap: wrap;

							.bottomupload-view {
								width: 100%;
								display: flex;

								.onloadimg-btn {
									width: 120rpx;
									margin-right: 50rpx;
									height: 120rpx;
									background-color: #f4f4f4;
									border: 4rpx solid #ccc;
									display: flex;
									justify-content: center;
									align-items: center;
								}
							}

							.u-upload.data-v-c8491d64 {
								flex: none !important;
							}

							.u-upload__button.data-v-c8491d64 {
								width: 110rpx !important;
								height: 110rpx !important;
							}

							.u-upload__wrap__preview__image.data-v-c8491d64 {
								width: 110rpx !important;
								height: 110rpx !important;
							}

							.u-upload__wrap__preview__other.data-v-c8491d64 {
								width: 110rpx !important;
								height: 110rpx !important;
							}
						}
					}
				}

				/* 选择赏金 */
				.content-reward-bounty {
					width: 750rpx;
					height: 220rpx;
					background: #FFFFFF;
					box-sizing: border-box;
					padding: 39rpx 24rpx 35rpx 0;
					margin-bottom: 40rpx;

					.reward-bounty-title {
						font-size: 36rpx;
						font-family: Source Han Sans CN-Regular, Source Han Sans CN;
						font-weight: 600;
						color: #333333;
						line-height: 36rpx;
						margin-left: 28rpx;
						margin-bottom: 14rpx;
					}

					.reward-bounty-content {
						width: 100%;
						box-sizing: border-box;
						padding-left: 31rpx;
						display: flex;
						justify-content: space-between;

						.bounty-content-moeny {
							width: 123rpx;
							height: 50rpx;
							background: #FFE6B8;
							border-radius: 25rpx;
							text-align: center;
							font-size: 24rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #F09500;
							line-height: 50rpx;
							display: inline-block;
						}

						.bounty-content-moenyactive {
							color: #fff;
							background: linear-gradient(151deg, #FFE6B8 0%, #F09500 100%);
						}

						.bounty-content-input {
							width: 123rpx;
							height: 50rpx;
							box-sizing: border-box;
							border: 2rpx solid #FFE6B8;
							border-radius: 25rpx;
							text-align: center;
							font-size: 24rpx;
							font-family: Source Han Sans CN-Regular, Source Han Sans CN;
							font-weight: 400;
							color: #F09500;
							line-height: 50rpx;
							display: inline-block;
						}
					}
				}

				/* 提交按钮 */
				.content-reward-submitbtn {
					width: 455rpx;
					height: 120rpx;
					background: #E1E1E1;
					border-radius: 80rpx;
					text-align: center;
					font-size: 36rpx;
					font-family: Source Han Sans CN-Bold, Source Han Sans CN;
					font-weight: 700;
					color: #B3B3B3;
					line-height: 120rpx;
				}

				.content-reward-submitbtnactive {
					background-color: #F09500;
					color: #fff;
				}
			}
		}
	}
</style>